#加减乘除
def jiafa(x):#x:输入数字个数
    a = []
    sum = 0
    num = 0
    for i in range(0,x):
        num = int(input("请输入数字："))
        a.append(num)
    for i in a:
        sum += i
    print("这{}个数字的和为{}".format(num, sum))

def jianfa(*args): #第一个数减后面所有的数
    args = list(args)
    aa = args[0][0]
    for i in range(1,len(args[0])):
        aa = aa - args[0][i]
    print("第一个数减后面的数的结果为{}".format(aa))

def chengfa(*args): #每个数相乘
    args = list(args)
    sum = args[0][0]
    for i in range(1,len(args[0])):
        sum = sum * args[0][i]
    print("这{}个数的乘积为{}".format(len(args[0]),sum))

def chufa(*args): #第一个数除以后面的数 如果除数为0 则接着除以后面不为0的数
    args = list(args)
    sum = args[0][0]
    for i in range(1,len(args[0])):
        if(args[0][i] == 0):
            continue
        else:
            sum = sum / args[0][i]
    print("第一个数除以后面的数的结果为{}".format(sum))
def menu():
    print("** 1: 加法运算 **")
    print("** 2: 减法运算 **")
    print("** 3: 乘法运算 **")
    print("** 4: 除法运算 **")
    print("** 5: 退出 ******")
def main():
    aa = []
    while True:
        menu()
        choose = int(input("请输入你的选择"))
        if choose == 1:
            x = int(input("请输入数字个数："))
            jiafa(x)
        if choose == 2:
            bb = int(input("请输入数字个数："))
            for i in range(0,bb):
                y = int(input("请输入数字："))
                aa.append(y)
            jianfa(aa)
            aa = []
        if choose == 3:
            cc = int(input("请输入数字个数："))
            for i in range(0,cc):
                z = int(input("请输入数字："))
                aa.append(z)
            chengfa(aa)
            aa = []
        if choose == 4:
            dd = int(input("请输入数字个数："))
            for i in range(0,dd):
                w = int(input("请输入数字："))
                aa.append(w)
            chufa(aa)
            aa = []
        if choose == 5:
            print("谢谢你的使用")
            break
main()